<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="search">
<script>
    var search = document.querySelector('#search');
    document.addEventListener('keyup',function (e) {
        /*console.log(e.keyCode);*/
        if (e.keyCode == 83) {
            search.focus();
        }
    })
</script>
</body>
</html>